package com.meiyu.live.tv.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;

import com.meiyu.live.R;

/**
 * Created by zbl on 2016/9/11.
 */
public class GameListView extends FrameLayout implements View.OnClickListener {

    private Context context;

    private StartGameListener listener;

    @Override
    public void onClick(View view) {

    }

    public interface StartGameListener {
        void onStartGame();
    }

    public GameListView(Context context) {
        super(context);
        init(context);
    }

    public GameListView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init(context);
    }

    private void init(Context context) {
        this.context = context;
        LayoutInflater.from(context).inflate(R.layout.view_gamelist, this);

        View niuniu = findViewById(R.id.iv_niuniu);
        niuniu.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                listener.onStartGame();
            }
        });

    }

    public void setOnStartGameListener(StartGameListener listener) {
        this.listener = listener;
    }


}
